package com.no.seckill.service.Impl;

import com.no.seckill.dao.ProviderMapper;
import com.no.seckill.entity.Provider;
import com.no.seckill.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zhang kun
 * @Classname ProviderServiceImpl
 * @Description TODO
 * @Date 2021/9/1 21:40
 */
@Service
public class ProviderServiceImpl implements ProviderService {
    @Autowired(required = false)
    ProviderMapper providerMapper;

    @Override
    public List<Provider> selectAll() {
        List<Provider> list = providerMapper.selectAll();
        return list;
    }

    @Override
    public void insert(Provider provider){
        int insert = providerMapper.insert(provider);
    }
    @Override
    public void delete(String name,String code){
        int insert = providerMapper.deleteByPrimaryKey(name,code);
    }

    @Override
    public int update(Provider provider) {
        int update = providerMapper.updateByPrimaryKey(provider);
        return update;
    }
}
